#include "BountyQuest.h"


BountyQuest::BountyQuest()
{
	Target = 0;
}

BountyQuest::~BountyQuest()
{

}

void BountyQuest::Intialise()
{
	//set target to be alive
	if(Target)
	{
		Target->SetIsAlive(true);
	}
}

void BountyQuest::Update(float delta,XMFLOAT3 playerpos)
{
	if(!GetFailed() && !GetIsCompleted())
	{
		//if pointer is not null
		if(Target)
		{
			//if tragte is not alive
			if(!Target->GetIsAlive())	
			{
				//quest is completed
				SetIsCompleted(true);
			}
		}
	}

}

void BountyQuest::SetValues(AbstractEnemy* target)
{
	//set target
	Target = target;

	//set target to be dead
	if(Target)
	{
		Target->SetIsAlive(false);
	}
}